package org.example.boot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author liyang
 * @version 1.0
 * @package org.example.boot01.controller
 * @file HelloController.java
 * @description
 * @time 2024/7/16 下午9:04
 */

@Controller
public class HelloController {
    @RequestMapping("/hello")
    public void hello(HttpServletResponse response) throws IOException {
        response.setContentType("text/html;charset=utf-8");

        PrintWriter pw = response.getWriter();
        pw.println("测试成功");
        pw.close();
    }
}
